#include "InterpretPrescription.h"
#include "CodeMethod.h"

Object* InterpretPrescription::executeClosure(Image* image,Closure* closure,int argc,Object** argv){
   printf("Executing closure.\n");
}
void InterpretPrescription::print(Image* image){
   printf("[");
   for(int i=0;i<args.size();i++){
      printf("%s",args[i].name.c_str());
   }
   printf("|");
   for(int i=0;i<temps.size();i++){
      printf("%s",temps[i].name.c_str());
   }
   printf("|");
   for(int i=0;i<code.size();i++){
      print_stmt(image,code[i]);
   }
   printf("]");
}
InterpretPrescription* InterpretPrescription::addArgument(Type* type,string name){
   Argument a;
   a.name=name;
   a.type=type;
   args.push_back(a);
}
InterpretPrescription* InterpretPrescription::addTemp(Type* type,string name){
   Argument a;
   a.name=name;
   a.type=type;
   temps.push_back(a);
}
InterpretPrescription* InterpretPrescription::add(Statement stmt){
   code.push_back(stmt);
}
